<template>
  <div class="ArticleDetail">
    <div ref="editor" style="text-align:left"></div>
  </div>
</template>

<script>
import E from 'wangeditor'
var editor;

export default {
  name: "fc-editor",
  data: function () {
    return {
      Title:'',
      Content:''
    }
  },
  mounted:function(){
    var That = this;
    editor = new E(this.$refs.editor);
    editor.customConfig = {
      onchange:function(html){
        That.Content = html
      },
      uploadImgServer: 'https://jsonplaceholder.typicode.com/posts/', // 上传图片到服务器
      uploadFileName : 'Content', //后端使用这个字段获取图片信息
      uploadImgMaxLength : 1 , // 限制一次最多上传 1 张图片
    };

    editor.create();
  }
}
</script>
